package com.atguigu.gulimall.product.service;

import com.atguigu.gulimall.product.vo.AttrRespVO;
import com.atguigu.gulimall.product.vo.AttrVO;
import com.baomidou.mybatisplus.extension.service.IService;
import com.atguigu.common.utils.PageUtils;
import com.atguigu.gulimall.product.entity.AttrEntity;

import java.util.List;
import java.util.Map;

/**
 * 商品属性
 *
 * @author ghh
 * @email 1974694751@qq.com
 * @date 2022-03-03 00:40:08
 */
public interface AttrService extends IService<AttrEntity> {

    PageUtils queryPage(Map<String, Object> params);

    void saveAttr(AttrVO attr);

    PageUtils queryBaseAttrPage(Map<String, Object> params, Long catelogId, String attrType);

    void updateAttr(AttrVO attr);

    AttrRespVO getAttrInfo(Long attrId);

    /**
     * 通过分组id，查询关联属性
     * @param attrgroupId
     * @return
     */
    List<AttrEntity> getAttrRelation(Long attrgroupId);

    /**
     * 获取当前分组没有关联的所有属性
     * @param attrgroupId
     * @param params
     * @return
     */
    PageUtils getAttrNoRelation(Long attrgroupId, Map<String, Object> params);

    /**
     * 删除属性
     * @param asList
     */
    void removeAttrs(List<Long> asList) throws Exception;
}

